public class Stu {
    private String name; // 学生姓名
    private int age; // 学生年龄
    private int grade; // 学生年级

    // 构造函数
    public Stu(String name, int age, int grade) {
        this.name = name;
        this.age = age;
        this.grade = grade;
    }

    // 学生自我介绍的方法
    public void introduce() {
        System.out.println("Hello, my name is " + this.name +
                           ", I am " + this.age +
                           " years old and I am in grade " + this.grade + ".");
    }

    // 主类
    public static void main(String[] args) 
    {
            // 使用学生类创建对象
            Stu student1 = new Stu("Alice", 20, 10);
            Stu student2 = new Stu("Bob", 22, 11);
            // 调用方法
            student1.introduce();
            student2.introduce();
    }  
}
